package com.liu.shop.mapper;

import com.liu.shop.common.vo.StockVo;
import com.liu.shop.entity.OrderDetailEntity;
import com.liu.shop.entity.OrderEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


public interface OrderDao {

    public int createOrder(@Param("orderEntity") OrderEntity orderEntity, @Param("tabIndex") Integer tabIndex);

    int addOrderDetail(@Param("odList") List<OrderDetailEntity> odList,@Param("tabIndex") Integer tabIndex);

    //进行了分库分表，根据订单编号查询订单信息
    OrderEntity getOrderById(@Param("orderId") String orderId,@Param("tabIndex") Integer tabIndex);

    // 修改订单状态
    void updateOrderStatus(@Param("orderId") String orderId,@Param("tabIndex") Integer tabIndex,@RequestParam("status") Integer status);

    // 查询库存信息
    List<StockVo> getStockVoListOrderId(@Param("orderId") String orderId, @Param("tabIndex") Integer tabIndex);
}
